package com.example.demo.Controller;

import com.example.demo.demoEntity.TUserEntity;
import com.example.demo.demoEntity.TUserRoleEntity;
import com.example.demo.mapper.TUserEntityMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.File;
import java.util.List;

@RestController
public class TuserController {
    private TUserEntityMapper usermapper;
@Autowired
    public void setUsermapper(TUserEntityMapper usermapper) {
        this.usermapper = usermapper;
    }
    @RequestMapping
    public String a(){
        List<TUserEntity> all = usermapper.findAll();
        return all+"";
    }
    @RequestMapping("mohu")
    public String b(String username){
        List<TUserEntity> all = usermapper.findByUserNameContaining(username);
        return all+"";
    }
    @RequestMapping("duotiaojian")
    public String c(String username,String password){
        List<TUserEntity> all = usermapper.queryParamByTUserEntityUserName(new TUserEntity(1,username,password));
        return all+"";
    }
    @RequestMapping("xianwan")
    public String d(){
        List<TUserRoleEntity> tUserEntities = usermapper.queryByQuanxian();

        System.out.println(33333);
        return tUserEntities+"";
    }
}
